{$IFNDEF ICOLIB}
{$DEFINE ICOLIB}

type
  PSKINICONDESC = ^TSKINICONDESC;
  TSKINICONDESC = record
    cbSize         :int;
    szSection      :TChar; // section name used to group icons
    szDescription  :TChar; // description for options dialog
    pszName        :PChar; // name to refer to icon when playing and in db
                           // this name is miranda-wide. so use prefixes of
                           // your plugin: "isee_connect", "clist_delete", etc
    // pszDefaultFile :TChar; // default icon file to use
    pszDefaultFile :PChar; // changed by LA
    iDefaultIndex  :int;   // index of icon in default file
    // V2
    hDefaultIcon   :HICON; // handle to default icon
    // V3
    cx, cy         :int;   // dimensions of icon
    // new
    flags          :int;
  end;

const
  SKINICONDESC_SIZE    = SizeOf(TSKINICONDESC);
  SKINICONDESC_SIZE_V1 = $18;
  SKINICONDESC_SIZE_V2 = $1C;
  SKINICONDESC_SIZE_V3 = $24;

const
  SIDF_SORTED       = 1;    // Icons in section are sorted by name
  SIDF_UNICODE      = $100; // Section and Description are in UCS-2
  SIDF_PATH_UNICODE = $200; // Default File is in UCS-2
  SIDF_ALL_UNICODE  = SIDF_PATH_UNICODE or SIDF_UNICODE;

const
{
  Add a icon into options UI

  wParam = 0
  lParam = PSKINICONDESC
  returns a handle to the newly added item
}
  MS_SKIN2_ADDICON = 'Skin2/Icons/AddIcon';

{
  Remove a icon from options UI

  wParam = 0
  lParam = pszName
  WARNING: This will invalidate all HICONs retrieved for specified pszName
}
  MS_SKIN2_REMOVEICON = 'Skin2/Icons/RemoveIcon';
{
  Retrieve HICON with name specified in lParam
  Returned HICON SHOULDN'T be destroyed, it managed by IcoLib

  wParam = 0
  lParam = pszName
}
  MS_SKIN2_GETICON = 'Skin2/Icons/GetIcon';

{
  Retrieve HICON with HANDLE specified in lParam
  Returned HICON SHOULDN'T be destroyed, it is managed by IcoLib
}
  MS_SKIN2_GETICONBYHANDLE = 'Skin2/Icons/GetIconByHandle';

{
  Add reference to HICON

  wParam = (WPARAM)HICON
  lParam = 0
}
  MS_SKIN2_ADDREFICON = 'Skin2/Icons/AddRef';

{
  Retrieved HICON is not needed anymore (this helps optimize GDI usage)

  wParam = HICON (optional)
  lParam = pszName (optional)  // at least one needs to be specified
}
  MS_SKIN2_RELEASEICON = 'Skin2/Icons/ReleaseIcon';

{
  Check whether HICON is managed by IcoLib

  wParam = (WPARAM)HICON
  lParam = 0
}
  MS_SKIN2_ISMANAGEDICON = 'Skin2/Icons/IsManaged';

{
  Icons change notification
}
  ME_SKIN2_ICONSCHANGED = 'Skin2/IconsChanged';

{$ENDIF}